package edu.neu.swc.commerce.sampler;

import brave.sampler.DeclarativeSampler;
import brave.sampler.RateLimitingSampler;
import brave.sampler.Sampler;
import org.springframework.cloud.sleuth.sampler.ProbabilityBasedSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <h1>使用配置的方式设定抽样率</h1>
 */
@Configuration
public class SamplerConfig {

    /**
     * <h2>设置限速采集</h2>
     */
//    @Bean
//    public Sampler sampler(){
//        return RateLimitingSampler.create(100);
//    }

    /**
     * <h2>概率采集</h2>
     */
//    @Bean
//    public Sampler defaultSampler(){
//        return ProbabilityBasedSampler.create(0.5f);
//    }

}
